package com.dhecp.project.logstics.controller;

import com.dhecp.common.annotation.Log;
import com.dhecp.common.annotation.RepeatSubmit;
import com.dhecp.common.config.Global;
import com.dhecp.common.core.domain.AjaxResult;
import com.dhecp.common.core.page.TableDataInfo;
import com.dhecp.common.enums.BusinessType;
import com.dhecp.common.utils.DateUtils;
import com.dhecp.common.utils.TypeUtils;
import com.dhecp.core.constant.ModuleTable;
import com.dhecp.core.layui.GridColumnsPropertyModel;
import com.dhecp.core.utils.DateUtil;
import com.dhecp.core.utils.ExportExcelUtils;
import com.dhecp.core.utils.PdfUtil;
import com.dhecp.framework.util.ShiroUtils;
import com.dhecp.project.base.domain.CompanyInfo;
import com.dhecp.project.base.service.CompanyInfoService;
import com.dhecp.project.business.domain.FbaLogsticsOrder;
import com.dhecp.project.common.controller.BaseModuleController;
import com.dhecp.project.common.domain.ModuleNidAndBid;
import com.dhecp.project.common.service.ModuleNidAndBidService;
import com.dhecp.project.flowable.domain.ActHistoricActivity;
import com.dhecp.project.flowable.service.ActProcessService;
import com.dhecp.project.logstics.domain.FbaLogisticsPaymentEc;
import com.dhecp.project.logstics.domain.FbaLogisticsPaymentEcSon;
import com.dhecp.project.logstics.service.FbaLogisticsPaymentEcService;
import com.dhecp.project.logstics.service.FbaLogisticsPaymentEcSonService;
import com.dhecp.project.system.domain.SysDictionaryForExport;
import com.dhecp.project.system.domain.SysUserInfo;
import com.dhecp.project.system.service.SysDictionaryForFieldService;
import com.dhecp.project.system.service.SysUserInfoService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import java.math.BigDecimal;
import java.util.*;

/**
 * 物流二次付款单(FbalogisticsPaymentEc)控制层
 *
 * @author fxz
 * @since 2022-10-29 23:27:27
 */
@Controller
@RequestMapping("/logstics/fbaLogisticsPaymentEc")
public class FbaLogisticsPaymentEcController extends BaseModuleController{

    private String prefix = "logstics/fbaLogisticsPaymentEc";
    private String moduleTable = ModuleTable.TP_FBALOGISTICSPAYMENTEC;
    private String moduleTable1 = ModuleTable.TP_FBALOGISTICSPAYMENTECSON;
    private String moduleTable2 = ModuleTable.FBA_LOGSTICSORDER;

    @Autowired
    private SysDictionaryForFieldService dictionaryForFieldService;

    @Autowired
    private FbaLogisticsPaymentEcService fbaLogisticsPaymentEcService;

    @Autowired
    private FbaLogisticsPaymentEcSonService fbaLogisticsPaymentEcSonService;

    @Autowired
    private GridColumnsPropertyModel gridColumnsPropertyModel;

    @Autowired
    private ModuleNidAndBidService moduleNidAndBidService;
    @Autowired
    private ActProcessService actProcessService;
    @Autowired
    private CompanyInfoService companyInfoService;
    @Autowired
    private SysUserInfoService sysUserInfoService;

    /**
     * @Description: 打开查询列表页
     * @Param: [params]
     * @return: org.springframework.web.servlet.ModelAndView
     * @Author: hlf
     * @date: 2022-08-15 15:42
     */
    @RequiresPermissions("logstics:fbaLogisticsPaymentEc:view")
    @GetMapping()
    public ModelAndView view(@RequestParam Map<String, Object> params) {
        params.put("moduleTable", moduleTable);
        params.put("entity", new FbaLogisticsPaymentEc()); //生成表格gridColumns对应的实体，用于获取实体属性生成表格字段
        params.put("prefix", prefix + "/fbaLogisticsPaymentEc"); //页面路径
        params.put("toolBarWidth", 0);
        params.put("checkBox", "yes");

        ModelAndView mv = this.openListPage(params);
        mv.addObject("logstics", "fbaLogisticsPaymentEc");
        return mv;
    }

    /**
     * @Description: 查询页 列表数据
     * @Param: [params]
     * @return: com.dhecp.common.core.page.TableDataInfo
     * @Author: hlf
     * @date: 2022-08-15 15:43
     */
    @RequiresPermissions("logstics:fbaLogisticsPaymentEc:list")
    @GetMapping("/list")
    @ResponseBody
    public TableDataInfo list(@RequestParam Map<String, Object> params) {
        params.put("moduleTable", moduleTable);
        List<FbaLogisticsPaymentEc> list = new ArrayList<FbaLogisticsPaymentEc>();
        try {
            list = fbaLogisticsPaymentEcService.queryListSoList(params);
        } catch (Exception e) {
            e.printStackTrace();
            return getDataTable(this.getExceptionMessage(e).toString());
        }
        return getDataTable(list);
    }

    /**
     * @Description: 数据导出Excel
     * @Param: [params]
     * @return: com.dhecp.common.core.domain.AjaxResult
     * @Author: hlf
     * @date: 2022-08-15 15:43
     */
    @RequiresPermissions("logstics:fbaLogisticsPaymentEc:export")
    @Log(title = "物流二次付款单导出", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    @ResponseBody
    @RepeatSubmit
    public AjaxResult export(@RequestParam Map<String, Object> params) throws Exception {
        params.put("moduleTable", moduleTable);
        params.put("entity", new FbaLogisticsPaymentEc());

        List<FbaLogisticsPaymentEc> list = fbaLogisticsPaymentEcService.queryListSoList(params);

        params.put("getFieldAttributesType", "export");
        List<SysDictionaryForExport> fieldList = dictionaryForFieldService.queryExportFieldList(params);
        ExportExcelUtils<FbaLogisticsPaymentEc> util = new ExportExcelUtils<FbaLogisticsPaymentEc>(moduleTable, new FbaLogisticsPaymentEc());
        return util.exportExcel(list, fieldList, "物流二次付款单", "export");
    }

    /**
     * @Description: 查询页 子列表数据
     * @Param: [params]
     * @return: com.dhecp.common.core.page.TableDataInfo
     * @Author: hlf
     * @date: 2022-08-15 15:43
     */
    @RequiresPermissions("logstics:fbaLogisticsPaymentEc:list")
    @GetMapping("/sonlist")
    @ResponseBody
    public AjaxResult sonlist(@RequestParam Map<String, Object> params) {
        try {
            params.put("moduleTable", moduleTable1);
            params.put("entity", new FbaLogisticsPaymentEcSon()); //生成表格gridColumns对应的实体，用于获取实体属性生成表格字段
            params.put("toolBarWidth", 0);
            AjaxResult ajaxResult = new AjaxResult();
            Map<String, Object> dictionaryForFieldMap = new HashMap<String, Object>();
            Map<String, Object> mapList = new HashMap<>();
            mapList.put("sonList", fbaLogisticsPaymentEcSonService.queryList(params));
            mapList.put("fields", TypeUtils.mapToJson(dictionaryForFieldMap));
            mapList.put("gridColumns", gridColumnsPropertyModel.queryGridColumnsPropertyModel(params));
            ajaxResult = AjaxResult.success(mapList);
            return ajaxResult;
        } catch (Exception e) {
            return AjaxResult.error(this.getExceptionMessage(e));
        }
    }

    /**
     * @Description: 打开制单页
     * @Param: nid 必要参数：单据编码（新增时传默认值 0 ，修改、查看时传单据实际值）
     * @return: org.springframework.web.servlet.ModelAndView
     * @Author: hlf
     * @date: 2022-08-15 15:42
     */
    @RequiresPermissions("logstics:fbaLogisticsPaymentEc:view")
    @GetMapping("/edit")
    public ModelAndView editPage(@RequestParam Map<String, Object> params) {
        if (params.get("nid") == null || params.get("nid") == "") {
            params.put("nid", "0");
        }
        params.put("moduleTable", moduleTable);
        params.put("entity", new FbaLogisticsPaymentEc()); //用于获取实体属性名取代对应字典字段名，解决大小写敏感问题
        params.put("moduleUrl", prefix); //页面上级路径
        params.put("prefix", prefix + "/fbaLogisticsPaymentEc_edit"); //页面路径
        Subject userSubject = ShiroUtils.getSubject();
        int enableEdit = 0;
        boolean vType = false;
        if (params.get(enableEdit) == null || "1".equals(params.get(enableEdit).toString())) {
            if (userSubject.isPermitted("logstics:fbaLogisticsPaymentEc:edit")) { //当前登录用户主体是否有修改的权限
                enableEdit = 1;
            }
        }

        try {
            Map<String, Object> headData = new HashMap<String, Object>();        //表头的业务数据
//          SysModuleSet moduleSet = sysModuleSetService.queryModuleSet(params);//单据设置信息
            FbaLogisticsPaymentEc businessData = fbaLogisticsPaymentEcService.queryFirstRecord(params);
            if (businessData == null) { //未查询到对应单据，页面初始化值
                ModuleNidAndBid moduleNidAndBid = moduleNidAndBidService.queryModuleNidAndBidInitial(params);
                FbaLogisticsPaymentEc fbaLogisticsPaymentEc = new FbaLogisticsPaymentEc();
                fbaLogisticsPaymentEc.setNid("0");
                fbaLogisticsPaymentEc.setBid(moduleNidAndBid.getBid());
                fbaLogisticsPaymentEc.setCode(moduleNidAndBid.getBid());
                fbaLogisticsPaymentEc.setCreateTime(new Date());
                //fbaLogisticsPaymentEc.setWriteTime(new Date());
                fbaLogisticsPaymentEc.setCid(ShiroUtils.getMandatorCid());
                fbaLogisticsPaymentEc.setCidName(ShiroUtils.getMandatorCidName());
                fbaLogisticsPaymentEc.setbUser(ShiroUtils.getMandatorId());
                fbaLogisticsPaymentEc.setbUserName(ShiroUtils.getMandatorName());
                fbaLogisticsPaymentEc.setbDept(ShiroUtils.getMandatorDeptPath());
                fbaLogisticsPaymentEc.setbDeptName(ShiroUtils.getMandatorDeptName());
                fbaLogisticsPaymentEc.setbPosition(ShiroUtils.getMandatorPositionNameDa());
                fbaLogisticsPaymentEc.setaUser(ShiroUtils.getUserId());
                fbaLogisticsPaymentEc.setaUserName(ShiroUtils.getUserName());
                fbaLogisticsPaymentEc.setaDept(ShiroUtils.getUserDeptPath());
                fbaLogisticsPaymentEc.setaDeptName(ShiroUtils.getUserDeptName());
                fbaLogisticsPaymentEc.setaPosition(ShiroUtils.getUserPositionNameDa());
                fbaLogisticsPaymentEc.setAmountCredit("0");
                headData = TypeUtils.entityToMap(fbaLogisticsPaymentEc);
            } else {
                headData = TypeUtils.entityToMap(businessData);
                vType = businessData.getEffectStock();
            }
            params.put("headData", headData); //表头的业务数据

            params.put("checkBox", "yes"); //生成表格gridColumns时包含复选
            ModelAndView mv = this.openEditPage(params);
            mv.addObject("nowTimeStr", DateUtils.getDate());    //当前日期
            mv.addObject("enableEdit", vType ? 0 : enableEdit); //当前页面是否可编辑（0：不可编辑，1：可编辑）
            if (businessData != null) {
                Map<String, Object> params2 = new HashMap<String, Object>();
                params2.put("moduleTable", moduleTable1);
                params2.put("code", businessData.getCode());
                mv.addObject("List", fbaLogisticsPaymentEcSonService.queryList(params2));//母件数据
            }
            //取商品子件列表网格
            params.put("moduleTable", moduleTable1);
            params.put("entity", new FbaLogisticsPaymentEcSon()); //生成表格gridColumns对应的实体，用于获取实体属性生成表格字段
            params.put("readOnly", vType);//生成列是否可编辑
            params.put("toolBarWidth", 0);//操作区
            params.put("getFieldAttributesType", "pageingrid");//pageingrid：网格字段
            params.put("checkBox", "yes");
            mv.addObject("gridColumnsZJ", gridColumnsPropertyModel.queryGridColumnsPropertyModel(params));

            return mv;
        } catch (Exception e) {
            return this.gotoModelAndViewErrorPage(e.getMessage());    //详细信息
        }

    }

    /**
     * @Description: 保存数据
     * @Param: infoMap 必要参数：非网格字段（包括头部、底部所有显示和隐藏的字段）
     * @Param: infoItems 必要参数：对应实体类的json格式字符串
     * @return: com.dhecp.common.core.domain.AjaxResult
     * @Author: hlf
     * @date: 2022-08-15 15:44
     */
    @RequiresPermissions(value = {"logstics:fbaLogisticsPaymentEc:add", "logstics:fbaLogisticsPaymentEc:edit", "logstics:fbaLogisticsPaymentEc:delete"}, logical = Logical.OR)
    @Log(title = "物流二次付款单", businessType = BusinessType.UPDATE)
    @PostMapping("/editpost")
    @ResponseBody
    @RepeatSubmit
    public AjaxResult editpost(@RequestParam Map<String, Object> params) {
        params.put("moduleTable", moduleTable);
        AjaxResult ajaxResult = new AjaxResult();
        try {
            ajaxResult = fbaLogisticsPaymentEcService.saveData(params);
        } catch (Exception e) {
            ajaxResult = AjaxResult.error(this.getExceptionMessage(e));
        }
        return ajaxResult;
    }

    /**
     *@Description: 查询前一单NID、BID
     *@Param: [params] nid 必要参数：当前 单据编码
     *@return: com.dhecp.common.core.domain.AjaxResult (data.nid 前一单NID， data.bid 前一单BID)
     *@Author: hlf
     *@date: 2022-05-09 11:40
     */
    @RequiresPermissions("logstics:fbaLogisticsPaymentEc:view")
    @GetMapping("/lastnid")
    @ResponseBody
    public AjaxResult lastNid(@RequestParam Map<String, Object> params){
        params.put("moduleTable", moduleTable);
        AjaxResult ajaxResult = new AjaxResult();
        try {
            ajaxResult = fbaLogisticsPaymentEcService.queryLastNid(params);
        }catch (Exception e) {
            ajaxResult = AjaxResult.error(this.getExceptionMessage(e));
        }
        return ajaxResult;
    }

    /**
     *@Description: 查询后一单NID、BID
     *@Param: [params] nid 必要参数：当前 单据编码
     *@return: com.dhecp.common.core.domain.AjaxResult (data.nid 后一单NID， data.bid 后一单BID)
     *@Author: hlf
     *@date: 2022-05-09 11:40
     */
    @RequiresPermissions("logstics:fbaLogisticsPaymentEc:view")
    @GetMapping("/nextnid")
    @ResponseBody
    public AjaxResult nextNid(@RequestParam Map<String, Object> params){
        params.put("moduleTable", moduleTable);
        AjaxResult ajaxResult = new AjaxResult();
        try {
            ajaxResult = fbaLogisticsPaymentEcService.queryNextNid(params);
        }catch (Exception e) {
            ajaxResult = AjaxResult.error(this.getExceptionMessage(e));
        }
        return ajaxResult;
    }

    /**
     * 打开流转页
     * @param fType 必要参数：审核类型（flow_go：流转，flow_back：退回）
     * @param infoMap 必要参数：非网格字段（包括所有显示和隐藏的字段），json格式字符串
     * @return
     * @author DH-Xxj
     */
    @RequiresPermissions("logstics:fbaLogisticsPaymentEc:view")
    @PostMapping("/flowpage")
    @ResponseBody
    public AjaxResult flowPage(@RequestParam Map<String, Object> params){
        params.put("moduleTable", moduleTable);
        params.put("prefix", prefix);
        return openFlowPage(params);
    }

    /**
     *@Description: 流转
     *@Param: [params] infoMap 必要参数：非网格字段（包括头部、底部所有显示和隐藏的字段）
     *@Param: [params] infoItems 必要参数：对应实体类的json格式字符串（仅需 guid）
     *@return: com.dhecp.common.core.domain.AjaxResult
     *@Author: hlf
     *@date: 2022-05-09 11:42
     */
    @RequiresPermissions("logstics:fbaLogisticsPaymentEc:view")
    @Log(title = "物流二次付款单", businessType = BusinessType.FLOWGO)
    @PostMapping("/flowgopost")
    @ResponseBody
    @RepeatSubmit
    public AjaxResult flowGoSave(@RequestParam Map<String, Object> params){
        params.put("moduleTable", moduleTable);
        AjaxResult ajaxResult = new AjaxResult();
        try {
            ajaxResult= fbaLogisticsPaymentEcService.updateFlowGo(params);
        }catch (Exception e) {
            ajaxResult = AjaxResult.error(this.getExceptionMessage(e));
        }
        return ajaxResult;
    }

    /**
     *@Description: 退回
     *@Param: [params] infoMap 必要参数：非网格字段（包括头部、底部所有显示和隐藏的字段）
     *@Param: [params] 必要参数：对应实体类的json格式字符串（仅需 guid）
     *@return: com.dhecp.common.core.domain.AjaxResult
     *@Author: hlf
     *@date: 2022-05-09 11:42
     */
    @RequiresPermissions("logstics:fbaLogisticsPaymentEc:view")
    @Log(title = "物流二次付款单", businessType = BusinessType.FLOWBACK)
    @PostMapping("/flowbackpost")
    @ResponseBody
    @RepeatSubmit
    public AjaxResult flowBackSave(@RequestParam Map<String, Object> params){
        params.put("moduleTable", moduleTable);
        AjaxResult ajaxResult = new AjaxResult();
        try {
            ajaxResult= fbaLogisticsPaymentEcService.updateFlowBack(params);
        }catch (Exception e) {
            ajaxResult = AjaxResult.error(this.getExceptionMessage(e));
        }
        return ajaxResult;
    }


    /**
     * 打开物流下单选择页面
     *
     * @param params
     * @return ModelAndView
     * @author DH-Xxj
     */
    @GetMapping("/select2")
    public ModelAndView selectbusinessList(@RequestParam Map<String, Object> params) {
        params.put("moduleTable", moduleTable2);
        params.put("entity", new FbaLogsticsOrder()); //生成表格gridColumns对应的实体，用于获取实体属性生成表格字段
        params.put("toolBarWidth", 0);
        if (params.get("pagetype") != null && params.get("pagetype").toString().equalsIgnoreCase("checkbox"))
            params.put("checkBox", "yes");
        else params.put("radio", "yes");
        ModelAndView mv = this.getModelAndView();
        AjaxResult ajaxResult = new AjaxResult();
        Map<String, Object> dictionaryForFieldMap = new HashMap<String, Object>();
        mv.addObject("fields", TypeUtils.mapToJson(dictionaryForFieldMap));
        mv.addObject("ajaxResult", ajaxResult);
        mv.addObject("gridColumns", gridColumnsPropertyModel.queryGridColumnsPropertyModel(params));
        mv.addObject("prefix", "/logstics/fbaLogisticsOrder");
        mv.addObject("moduleTable", moduleTable2);
        mv.addObject("pagetype", params.get("pagetype").toString());
        mv.addObject("fmoduleTable", params.get("fmoduleTable").toString());
        if (params.get("selectedObject") != null && params.get("selectedObject") != "") {
            String selectedObject = params.get("selectedObject").toString();
            mv.addObject("selectedObject", selectedObject);
        }
        mv.addObject("codeCompany", params.get("codeCompany").toString());
        mv.addObject("codereconcile", params.get("codereconcile").toString());

        mv.setViewName("system/organization/mzjobject_select");
        return mv;
    }

    /**
     *
     * @param params
     * @return
     */
    @PostMapping("/generatePDF")
    @ResponseBody
    public AjaxResult generatePDF(String bid){

        AjaxResult ajaxResult = new AjaxResult();
        
        if (bid == null || bid.length() == 0) {
			return AjaxResult.error("单据不能为空");
		}
        
        System.out.println("bid---" + bid);
        	
        try {
        	// 查找物流二次付款单
            FbaLogisticsPaymentEc fbaLogisticsPaymentEc = fbaLogisticsPaymentEcService.queryByBid(bid);
        	if (fbaLogisticsPaymentEc == null) {
    			return AjaxResult.error("单据不存在");
			}

            String pdfFileName = "/" + bid + ".pdf";
        	
            // 生成PDF到指定目录下
			String dir = Global.getProfile();
//			Map<String, Object> params = new HashMap<String, Object>();
//        	params.put("moduleTable", moduleTable1);
//        	params.put("entity", new FbaBox());
//        	params.put("codePayment", bid);
        	
//        	List<FbaLogisticsPaymentEcSon> listFbaLogisticsPaymentEcSon = fbaLogisticsPaymentEcSonService.queryList(params);
    		// 单据总额
        	BigDecimal bpriceAll = new BigDecimal(fbaLogisticsPaymentEc.getLogisticsFeesFkTol());
        	
        	// 流程审批过程
            List<ActHistoricActivity> historicActivityList = actProcessService.queryActHistoricActivityByProcInstId(fbaLogisticsPaymentEc.getProcInstId());
        	List<PdfUtil.BaoXiaoDto.RowDto> rows = new ArrayList<PdfUtil.BaoXiaoDto.RowDto>();
        	for(ActHistoricActivity entity : historicActivityList) {
        		
        		String opeTime = entity.getEndTimeFormat();
        		String opeUser = entity.getAssigneeName();
        		String opeResult = entity.getResultStatusName();
        		String opeOpinion = entity.getComment();
        		String fileName = "--";
        		PdfUtil.BaoXiaoDto.RowDto row = new PdfUtil.BaoXiaoDto.RowDto(opeTime, opeUser, opeResult, opeOpinion, fileName);
        		rows.add(row);
        	}
        	
        	Map<String, Object> param2 = new HashMap<String, Object>();
        	param2.put("vId", fbaLogisticsPaymentEc.getCid());
        	CompanyInfo companyInfo = companyInfoService.queryCompanyInfoByVId(param2);
        	SysUserInfo sysUserInfo = sysUserInfoService.queryByUserId(fbaLogisticsPaymentEc.getbUser());
        	
        	// 明细数据
        	List<PdfUtil.BaoXiaoDto.DetailDto> detailArr = new ArrayList<PdfUtil.BaoXiaoDto.DetailDto>();

        	String title = "物流二次付款单";
        	String createCompany = companyInfo.getvName();
        	String createTime = DateUtil.getYYYY_MM_DD_HH_mm_ss(fbaLogisticsPaymentEc.getCreateTime());
        	String code = fbaLogisticsPaymentEc.getBid();
        	String applyUser = fbaLogisticsPaymentEc.getbUser() + "/" + sysUserInfo.getUserName();
        	String applyDept = sysUserInfo.getDeptName() + "/" + fbaLogisticsPaymentEc.getbPosition();
        	String payType = "物流二次付款";
        	String payAccount = fbaLogisticsPaymentEc.getPartnerName() + "/" + fbaLogisticsPaymentEc.getvKhh() + "/" + fbaLogisticsPaymentEc.getvYhZh();
        	String payAmount = bpriceAll.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
        	String remark = fbaLogisticsPaymentEc.getvZdbz();
        	String printTime = DateUtil.getYYYY_MM_DD_HH_mm_ss(new Date());
        	String printUser = ShiroUtils.getMandatorName();
        	String printDept = ShiroUtils.getMandatorDeptName();
            PdfUtil.BaoXiaoDto dto = new PdfUtil.BaoXiaoDto(title, createCompany, createTime, code, applyUser, applyDept, payType, payAccount, payAmount, remark, printTime, printUser, printDept, detailArr, rows);
            PdfUtil.generateFinancePdf(dir, pdfFileName, dto);
            String data = "/profile" + pdfFileName;
            ajaxResult = AjaxResult.success("物流二次付款单打印",data);
        }catch (Exception e) {
        	e.printStackTrace();
            ajaxResult = AjaxResult.error(this.getExceptionMessage(e));
        }
        return ajaxResult;
    }
    /**
     * 修改记账时间
     * @return
     * @author DH-Xxj
     */
    @RequiresPermissions("logstics:fbaLogisticsPaymentEc:edit")
    @Log(title = "修改记账时间", businessType = BusinessType.UPDATE)
    @PostMapping("/xgxxpost")
    @ResponseBody
    @RepeatSubmit
    public AjaxResult updateFsQk(@RequestParam Map<String, Object> params){
        params.put("moduleTable", moduleTable);
        AjaxResult ajaxResult = new AjaxResult();
        try {
            ajaxResult= fbaLogisticsPaymentEcService.updateWriteTime(params);
        }catch (Exception e) {
            ajaxResult = AjaxResult.error(this.getExceptionMessage(e));
        }
        return ajaxResult;
    }

}

